package com.blb.zycommunity.controller;

import com.blb.zycommunity.entity.ResponseResult;
import com.blb.zycommunity.entity.ZyComplete;
import com.blb.zycommunity.mapper.ZyCompleteMapper;
import com.blb.zycommunity.service.IZyCompleteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 处理人表controller
 */
@RestController
@RequestMapping("uni-app")
public class ZyCompleteController {

    @Autowired
    private IZyCompleteService iZyCompleteService;

    @Resource
    private ZyCompleteMapper zyCompleteMapper;

    /**
     * 查询所有
     */
    @GetMapping("/complete-all")
    public ResponseResult findAll(){
        List<ZyComplete> zyCompletes = iZyCompleteService.list();
        return ResponseResult.ok(zyCompletes);
    }

    /**
     * 根据处理人姓名查询电话
     */
    @GetMapping("/complete-name")
    public ResponseResult finaName(String name){
        ZyComplete zyComplete = zyCompleteMapper.findPhoneByName(name);
        return ResponseResult.ok(zyComplete);
    }


}
